﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public abstract class ListViewCellH : MonoBehaviour
{

    [HideInInspector]
    public ListViewControllerH controller;



    public RectTransform RectTransform { get; private set; }
    public Vector2 Size
    {
        get
        {
            if (RectTransform == null)
                RectTransform = this.transform as RectTransform;
            return RectTransform.sizeDelta;
        }
        set
        {
            if (Size == value) return;
            RectTransform.sizeDelta = value;
        }
    }

    public int index;

    public virtual string reuseIdentifier => this.GetType().Name;

    public virtual void OnInit()
    {

    }

    public virtual void OnUpdate(object data)
    {

    }

    public virtual void OnClose()
    {

    }
}
